{% extends "zinnia/base.html" %}
{% load i18n mptt_tags %}

{% block meta-description %}{% trans "Category list" %}{% endblock %}

{% block title %}{% trans "Categories" %}{% endblock %}

{% block body-class %}category-list{% endblock %}

{% block content %}
<h2>{% trans "Category list" %}</h2>

<ul class="category-root">
  {% recursetree object_list %}
  <li>
    <a href="{{ node.get_absolute_url }}" title="{% blocktrans with category=node %}Show all entries in {{ category }}{% endblocktrans %}">{{ node }}</a>
    {% blocktrans count entry_count=node.entries_published.count %}{{ entry_count }} entry{% plural %}{{ entry_count }} entries{% endblocktrans %}
    {% if node.description %}<p>{{ node.description|striptags|safe }}</p>{% endif %}
    {% if not node.is_leaf_node %}
    <ul class="category-children category-{{ node.slug }}">
      {{ children }}
    </ul>
    {% endif %}
  </li>
  {% endrecursetree %}
  {% if not object_list %}
  <li>
    {% trans "No categories yet." %}
  </li>
  {% endif %}
</ul>
{% endblock %}
